"""
Author: HuWen
@file: page_productiveness.py
@dateTime: 2025/8/15 15:37
加油加油！！！
"""
import logging

from common.base_page import BasePage
from playwright.sync_api import Page

from locators.basicSecurityInformation.basicProcessInfo.loc_productlineinfo import Productiveness


class Productivenesspage(BasePage):
    def __init__(self,page: Page):
        super().__init__(page)
        self.switch_menu("安全基础管理")
        self.switch_menu("生产档案(企业)")

    def add_prodctiveness(self,wp,name,code,note):
        logging.info("开始创建生产线信息")
        self.check(Productiveness.loc_productiveness)
        self.click(Productiveness.loc_add_productiveness)
        self.select(Productiveness.loc_add_productiveness_wp,text=wp)
        self.fill(Productiveness.loc_add_productiveness_name,text=name)
        self.fill(Productiveness.loc_add_productiveness_code,text=code)
        self.fill(Productiveness.loc_add_productiveness_notes,text=note)
        self.click(Productiveness.loc_add_productiveness_con)